/*    */ package andriod.service;
/*    */ 
/*    */ import andriod.dao.PersistDao;
/*    */ import com.jcrj.entity.ODocument;
/*    */ import com.jcrj.entity.OOrg;
/*    */ import com.jcrj.entity.OUser;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ 
/*    */ public class ArdDocService
/*    */ {
/*    */   private PersistDao persistDao;
/*    */ 
/*    */   public List<ODocument> getDocList(String processId, String status)
/*    */   {
/* 18 */     List list = new ArrayList();
/* 19 */     if ((processId != null) && (!"".equals(processId))) {
/* 20 */       String hql = "from ODocument f where f.processId in(" + processId + 
/* 21 */         ")" + " and f.sfstatus=" + status;
/* 22 */       hql = hql + " order by f.createTime desc";
/* 23 */       list = this.persistDao.find(hql);
/*    */     }
/* 25 */     return list;
/*    */   }
/*    */ 
/*    */   public long countDoc(String processId, String status)
/*    */   {
/* 30 */     long count = 0L;
/* 31 */     if ((processId != null) && (!"".equals(processId))) {
/* 32 */       String hql = "select count(f.id) from ODocument f where f.processId in(" + 
/* 33 */         processId + ")" + " and f.sfstatus=" + status;
/* 34 */       count = this.persistDao.findForLong(hql);
/*    */     }
/* 36 */     return count;
/*    */   }
/*    */ 
/*    */   public String getOrgExecutorOrgIds(int nodeId)
/*    */   {
/* 41 */     String sql = "select distinct(o.ID) from O_ORG o where o.DEL='0' start with o.ID in (select t.ACTOR from O_TASK_ACTOR t where t.NODE_ID = " + 
/* 44 */       nodeId + ") connect by prior o.ID = o.PID";
/* 45 */     List objs = this.persistDao.query(sql);
/* 46 */     StringBuffer ids = new StringBuffer();
/* 47 */     for (int i = 0; i < objs.size(); i++) {
/* 48 */       ids.append(objs.get(i));
/* 49 */       if (i < objs.size() - 1) {
/* 50 */         ids.append(",");
/*    */       }
/*    */     }
/* 53 */     return ids.toString();
/*    */   }
/*    */ 
/*    */   public List<OOrg> getOrgExecutorOrgList(String orgIds)
/*    */   {
/* 58 */     String hql = "from OOrg t where t.id in(" + orgIds + 
/* 59 */       ") order by t.px asc";
/* 60 */     List orgList = this.persistDao.find(hql);
/* 61 */     return orgList;
/*    */   }
/*    */ 
/*    */   public List<OUser> getOrgExecutorUserList(String orgIds)
/*    */   {
/* 66 */     String hql = "from OUser t where t.orgId in(" + orgIds + 
/* 67 */       ") order by t.px asc";
/* 68 */     List userList = this.persistDao.find(hql);
/* 69 */     return userList;
/*    */   }
/*    */ 
/*    */   public PersistDao getPersistDao() {
/* 73 */     return this.persistDao;
/*    */   }
/*    */ 
/*    */   public void setPersistDao(PersistDao persistDao) {
/* 77 */     this.persistDao = persistDao;
/*    */   }
/*    */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     andriod.service.ArdDocService
 * JD-Core Version:    0.6.0
 */